/**
 * redux action类型
 * 
 * @author Indolphin
 */

import * as models from '../interface';

// 用户登录、登出
export const UPDATE_USER = "update_user";
export type UPDATE_USER_TYPE = typeof UPDATE_USER;

export const LOGOUT_USER = "logout_user";
export type LOGOUT_USER_TYPE = typeof LOGOUT_USER;

export interface UpdateUserActionType {
    type: UPDATE_USER_TYPE,
    payload: models.User
}
export interface UserLogoutActionType {
    type: LOGOUT_USER_TYPE,
    payload: models.User
}
export type UserActionType = UpdateUserActionType | UserLogoutActionType;

// 界面加载、初始化
export const QUERY_MENUS = 'query_menus';
export type QUERY_MENUS_TYPE = typeof QUERY_MENUS;

export interface QueryMenusType {
    type: QUERY_MENUS_TYPE,
    payload: {
        menus: models.Menu[]
    }
}
export type MenuActionType = QueryMenusType;